<template>
  <div class="shujixq">
    <div class="booktop">
      <div class="top">
        <div class="top1">
          <div class="imgs" @click="fanhui()">
            <img src="../../assets/images/logon.png" alt="" />
          </div>
          <div class="lefts">
            <div></div>
            <div class="lefts1">浙江省非物质文化<br />数字文献中心</div>
            <div class="lefts2">
              ZhejiangProvinceIntangibleCultureDigitalLiteratureCenter
            </div>
          </div>
          <div class="rights">
            <div></div>
            <div class="ris1">
              <!-- <div class="ri">会员</div>
              <div class="ri">帮助</div>
              <div class="ri">我的</div> -->
              <div class="ri">&emsp;&emsp;</div>
              <div class="ri">&emsp;&emsp;</div>
              <!-- <div class="ri" style="cursor: pointer" @click="touser()">我的</div> -->
              <!-- <div class="ri">
                 <el-dropdown @command="handleCommand" trigger="click">
                  <span class="el-dropdown-link" style="cursor: pointer">
                    <span
                      style="
                        font-size: 18px;
                        font-family: Source Han Sans CN-Regular, Source Han Sans CN;
                        font-weight: 400;
                        color: #333333;
                      "
                      >欢迎
                    </span>
                    <span style="padding-left: 12px; font-size: 16px">
                      {{ yhm.yhm }}
                    </span>
                    <i
                      class="el-icon-arrow-down el-icon--right"
                      style="font-size: 14px"
                    ></i>
                  </span>
                  <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item @click="tologin()">退出登录</el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
              </div> -->
              
            </div>
            <div class="ris3">
              <el-form
                :inline="true"
                :model="formInline"
                class="demo-form-inline"
                style="width: 100%; display: flex; height: 56px"
              >
                <el-form-item
                  style="width: 382px; height: 56px; margin-bottom: 0"
                >
                  <el-input
                    v-model="formInline.user"
                    placeholder="输入关键词搜索"
                    style="width: 382px; height: 56px"
                  >
                    <img
                      slot="append"
                      src="../../assets/images/sousuo.png"
                      alt=""
                    />
                  </el-input>
                  <!-- <el-input placeholder="输入关键词搜索" v-model="formInline.user" class="input-with-select">
                        <el-button slot="append" icon="el-icon-search" @click="sousuos()"></el-button>
                        </el-input> -->
                </el-form-item>
                <el-form-item>
                  <div style="padding-left:20px;margin-top: 7px;cursor: pointer;" @click="onSubmit()">
                    <div style=" display: flex;align-items: center;height:100%;font-size: 18px;font-family: Source Han Sans CN-Regular, Source Han Sans CN;font-weight: 400;color: #911f23">高级检索 <i style="font-size:18px;font-weight:550" class="el-icon-arrow-right"></i></div>
                  </div>
                </el-form-item>
              </el-form>
            </div>
            <div class="ris2" v-if="showLogin">
              <div class="login">登录</div>
              <el-form ref="form" :model="formLogin">
                <el-form-item>
                  <div class="i1" :class="activet == 0 ? 'i1' : 'i2'">
                    <el-input
                      v-model="formLogin.name"
                      placeholder="请输入账号"
                      @blur="handleBlur"
                      @focus="handleFocus"
                    >
                      <i
                        slot="prefix"
                        class="el-input__icon el-icon-user"
                        style="font-size: 20px"
                        v-if="activet == 0"
                      ></i>
                      <i
                        slot="prefix"
                        class="el-input__icon el-icon-user"
                        style="font-size: 20px; color: #333333"
                        v-else
                      ></i>
                    </el-input>
                    <div class="zh">账号</div>
                  </div>
                </el-form-item>
                <el-form-item>
                  <div class="i1" :class="activet1 == 0 ? 'i1' : 'i2'">
                    <el-input
                      v-model="formLogin.padd"
                      placeholder="请输入密码"
                      @blur="handleBlur1"
                      @focus="handleFocus1"
                    >
                      <i
                        slot="prefix"
                        class="el-input__icon el-icon-lock"
                        style="font-size: 20px"
                        v-if="activet1 == 0"
                      ></i>
                      <i
                        slot="prefix"
                        class="el-input__icon el-icon-lock"
                        style="font-size: 20px; color: #333333"
                        v-else
                      ></i>
                    </el-input>
                    <div class="zh">密码</div>
                  </div>
                </el-form-item>
              </el-form>
              <div class="submit">登录</div>
              <div class="fts">
                <div class="fts1">立即注册</div>
                <div class="fts2">忘记密码</div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="video">
      <div class="video_wrap">
        <div class="video_title">{{yxxqlist.spmc}}</div>
        <div class="video_data">
          <!-- <i class="icon_1"></i> -->
          <span>来源：{{yxxqlist.sply}}</span>
          <!-- <i class="icon_2"></i>
          <span>540</span> -->
          <span>拍摄时间：{{yxxqlist.spscrq}}</span>
          <span>视频类别：{{yxxqlist.splbname}}</span>
          <span>拍摄者：{{yxxqlist.sppsz}}</span>
        </div>
        <div class="viedo_play">
          <div class="viedo_play_le">
            <video
              data-v-1bde27a0=""
              width="1012"
              height="572"
              autoplay 
              
              :src="'https://fwzwhycbhxxhpt.oss-cn-hangzhou-zwynet-d01-a.internet.cloud.zj.gov.cn/imagedata/'+yxxqlist.spid+'/'+yxxqlist.spid+'.mp4'"
              controls="controls"
              class="play"
            ></video>
            <!-- <div class="on_video_data"  @click="shoucang(57, yxxqlist.spid, yxxqlist.spmc, yxxqlist)"
                v-if="yxxqlist.sfsc == 0">
               <img src="../../assets/images/s1.png"  style="width:20px;height:20px" alt="" />
              <span>收藏</span>
            </div>
            <div class="on_video_data"  @click="qxshoucang(57, yxxqlist.spid, yxxqlist)"
                v-if="yxxqlist.sfsc == 1">
               <img src="../../assets/images/s2.png" alt="" style="width:20px;height:20px" />
              <span>收藏</span>
            </div> -->
            <div class="video_intro" v-html="yxxqlist.spsm">
              
            </div>
          </div>
          <div class="viedo_play_ri">
            <div class="video_failarmy_title" v-if="yxxqlist.xgspList!=null">
              <span></span>
              相关视频
            </div>
            <div class="video_failarmy_list" v-if="yxxqlist.xgspList!=null">
              <div class="video_failarmy_item" v-for="(item,index) in yxxqlist.xgspList" :key="item.spid" @click="toshipinxq(item.spid)">
                <div class="video_failarmy_item_le">
                  <img :src="item.sppicurl" alt="" />
                  <!-- <div class="time">04:13</div> -->
                </div>
                <div class="video_failarmy_item_ri">
                  <div class="video_failarmy_item_title">
                    {{item.mc}}
                  </div>
                  <div class="video_failarmy_item_bottom">
                    <!-- <i class="v1"></i>
                    <span>1365</span>
                    <i class="v2"></i>
                    <span>432</span> -->
                  </div>
                </div>
              </div>
             
            </div>
          </div>
        </div>
      </div>
    </div>

    <footbtn></footbtn>
  </div>
</template>
<style scoped  lang="scss">
::v-deep .el-input {
  display: flex;
  justify-content: center;
  color: #333333;
}
::v-deep .el-input--prefix .el-input__inner {
  width: 305px;
  border: 0px;
}
//搜索框
::v-deep .el-input-group > .el-input__inner {
  height: 56px;
  border: 0px;
}
::v-deep .el-input-group__append {
  border: none !important;
  background-color: #fff;
  padding: 0 45px 0 10px;
}
::v-deep .el-input-group__append img {
  width: 32px;
  height: 32px;
  padding-top: 12px;
  cursor: pointer;
}
::v-deep .el-button--primary {
  background-color: #911f23;
  border-color: #911f23;
  border-radius: 8px;
  height: 56px;
  width: 112px;
  margin-left: 16px;
}
::v-deep .el-form--inline .el-form-item {
  margin-right: 0;
}

.shujixq {
  width: 100%;
  background-color: #f7f7f8;
  .booktop {
    width: 100%;
    height: 200px;
    background: url("../../assets/images/booktop.png") no-repeat;
    background-size: 100% 100%;
    .top {
      width: 1400px;
      height: 176px;
      margin: 0 auto;
      // background-color: #F7F7F8;
      .top1 {
        position: relative;
        width: calc(100% - 0px);
        margin: 0 auto;
        height: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        // background-color: pink;
        .imgs {
          position: absolute;
          top: 0;
          width: 138px;
          height: 176px;
          z-index: 100;
          cursor: pointer;
          img {
            width: 100%;
            height: 100%;
          }
        }
        .lefts {
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          height: 100%;
          margin-left: 170px;
          .lefts1 {
            font-size: 24px;
            font-family: Source Han Sans CN-Regular, Source Han Sans CN;
            font-weight: 400;
            color: #333333;
            // line-height: 35px;
          }
          .lefts2 {
            font-size: 14px;
            font-family: Source Han Sans CN-Regular, Source Han Sans CN;
            font-weight: 400;
            color: #666666;
          }
        }
        .rights {
          position: relative;
          display: flex;
          flex-direction: column;
          align-items: flex-end;
          justify-content: space-between;
          // padding-bottom: 40px;
          height: 100%;
          .ris1 {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 18px;
            width: 362px;
            font-family: Source Han Sans CN-Regular, Source Han Sans CN;
            font-weight: 400;
            color: #3d3d3d;
            margin-top: 0px;
          }
          .ris2 {
            position: absolute;
            top: 90px;
            width: calc(362px - 48px);
            height: 290px;
            background: #ffffff;
            box-shadow: 0px 2px 16px 0px rgba(0, 0, 0, 0.2);
            border-radius: 8px 8px 8px 8px;
            opacity: 1;
            z-index: 20;
            padding: 24px;
            .login {
              width: 100%;
              text-align: center;
              font-size: 24px;
              font-family: Source Han Sans CN-Regular, Source Han Sans CN;
              font-weight: 400;
              color: #333333;
              padding-bottom: 24px;
            }
            .i1 {
              position: relative;
              width: 100%;
              height: 46px;
              background: url("../../assets/images/inputs.png") no-repeat;
              background-size: 100% 100%;
              display: flex;
              align-items: center;
              justify-content: center;
              .zh {
                position: absolute;
                top: -20px;
                left: 30px;
                font-size: 12px;
                font-family: Source Han Sans CN-Regular, Source Han Sans CN;
                font-weight: 400;
                color: #999999;
              }
            }
            .i2 {
              position: relative;
              width: 100%;
              height: 46px;
              background: url("../../assets/images/inputs1.png") no-repeat;
              background-size: 100% 100%;
              display: flex;
              align-items: center;
              justify-content: center;
              .zh {
                position: absolute;
                top: -20px;
                left: 30px;
                font-size: 12px;
                font-family: Source Han Sans CN-Regular, Source Han Sans CN;
                font-weight: 400;
                color: #333333;
              }
            }
            .submit {
              width: 100%;
              height: 46px;
              background: #911f23;
              border-radius: 8px 8px 8px 8px;
              opacity: 1;
              display: flex;
              justify-content: center;
              align-items: center;
              font-size: 18px;
              font-family: Source Han Sans CN-Regular, Source Han Sans CN;
              font-weight: 400;
              color: #ffffff;
            }
            .fts {
              width: 100%;
              display: flex;
              justify-content: space-between;
              margin-top: 10px;
              font-size: 12px;
              font-family: Source Han Sans CN-Regular, Source Han Sans CN;
              font-weight: 400;
              .fts1 {
                color: #911f23;
                cursor: pointer;
              }
              .fts2 {
                color: #cccccc;
                cursor: pointer;
              }
            }
          }
          .ris3 {
            // width: 362px;
            // margin-top: 37px;
          }
          .ri {
            padding-right: 30px;
          }
          .ri1 {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 68px;
            height: 38px;
            background: #911f23;
            border-radius: 8px 8px 8px 8px;
            opacity: 1;
            color: #fff;
            cursor: pointer;
          }
        }
      }
    }
  }
  .video {
    margin-top: 32px;
    .video_wrap {
      width: 1400px;
      margin: 0 auto;
      .video_title {
        font-size: 34px;
        font-weight: 400;
        color: #3d3d3d;
        line-height: 52px;
      }
      .video_data {
        display: flex;
        align-items: center;
        font-size: 16px;
        font-weight: 400;
        color: #666;
        padding: 8px 0 16px;
        .icon_1 {
          width: 24px;
          height: 24px;
          background: url("../../assets/images/v.png") no-repeat;
          display: block;
          background-size: 100%;
        }
        .icon_2 {
          width: 24px;
          height: 24px;
          background: url("../../assets/images/news.png") no-repeat;
          display: block;
          background-size: 100%;
        }
        span {
          padding-left: 5px;
          padding-right: 16px;
        }
        em {
          font-style: normal;
        }
      }
      .viedo_play {
        display: flex;
        justify-content: space-between;
        .viedo_play_le {
          width: 1012px;
          .on_video_data {
            display: flex;
            align-items: center;
            margin: 16px 0;
            padding-bottom: 16px;
            border-bottom: 1px solid #e5e5e5;

            .data1 {
              width: 17px;
              height: 17px;
              background: url("../../assets/images/s1.png") no-repeat;
              display: block;
              background-size: 100%;
            }
            .data2 {
              width: 17px;
              height: 17px;
              background: url("../../assets/images/like.png") no-repeat;
              display: block;
              background-size: 100%;
            }
            .data3 {
              width: 17px;
              height: 17px;
              background: url("../../assets/images/f1.png") no-repeat;
              display: block;
              background-size: 100%;
            }
            span,
            em {
              font-size: 12px;
              font-weight: 400;
              color: #999999;
            }
            span {
              margin: 0 8px 0 5px;
            }
            em {
              font-style: normal;
              margin-right: 5px;
            }
          }
          .video_intro {
            
            font-size: 14px;
            font-weight: 400;
            color: #666666;
            line-height: 22px;
            margin-bottom: 24px;
          }
        }
        .viedo_play_ri {
          width: 372px;
          .video_failarmy_title {
            font-size: 22px;
            font-weight: 500;
            color: #3d3d3d;
            display: flex;
            align-items: center;
            padding-bottom: 16px;
            span {
              width: 12px;
              height: 24px;
              background: #911f23;
              display: inline-block;
              margin-right: 12px;
            }
          }
          .video_failarmy_list {
            .video_failarmy_item {
              display: flex;
              justify-content: space-between;
              margin-bottom: 16px;
              .video_failarmy_item_le {
                width: 198px;
                height: 112px;
                position: relative;

                img {
                  width: 100%;
                  height: 100%;
                  border-radius: 4px;
                }
                .time {
                  position: absolute;
                  bottom: 8px;
                  right: 8px;
                  font-size: 12px;
                  color: #fff;
                }
              }
              .video_failarmy_item_ri {
                width: 165px;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                .video_failarmy_item_title {
                  font-size: 16px;
                  font-weight: 400;
                  color: #3d3d3d;
                  overflow: hidden;
                  text-overflow: ellipsis;
                  display: -webkit-box;
                  -webkit-line-clamp: 2;
                  -webkit-box-orient: vertical;
                }
                .video_failarmy_item_bottom {
                  display: flex;
                  align-items: center;
                  margin-bottom: 8px;
                  .v1 {
                    width: 17px;
                    height: 17px;
                    background: url("../../assets/images/v.png") no-repeat;
                    display: block;
                    background-size: 100%;
                  }
                  .v2 {
                    width: 17px;
                    height: 17px;
                    background: url("../../assets/images/news.png") no-repeat;
                    display: block;
                    background-size: 100%;
                  }
                  span {
                    font-size: 12px;
                    font-weight: 400;
                    color: #666666;
                    padding-left: 5px;
                    padding-right: 16px;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
</style>

<script>
 import { getyxxq ,gettuichu,getsc,
  getqxsc } from "@/api/api.js";
import footbtn from "../../components/foot/index.vue";
export default {
  data() {
    return {
      formLogin: {
        name: "",
        padd: "",
      },
      showLogin: false,
      activet: 0,
      activet1: 0,
      formInline: {
        user: "",
      },
      id:0,
      lx:0,
      yxxqlist:{},
      mc:'',
      yhm:{}
    };
  },
  created() {
    this.yhm = JSON.parse(sessionStorage.getItem("loginInfo"))?JSON.parse(sessionStorage.getItem("loginInfo")):""
    this.mc = sessionStorage.getItem("sousuo");
    this.id = this.$route.query.id
    this.lx = this.$route.query.lx
    this.yxxq()
  },
  mounted() {
    // this.drawChart()
  },
  methods: {
    toshipinxq(id,) {
      const { href } = this.$router.resolve({
        path: "/video",
        query: { id: id, lx: this.lx },
      });
      window.open(href, "_blank");
      // this.$router.push({ path: "/video", query: { id: id,lx:lx } });
    },
     touser(){
      const {href} = this.$router.resolve({ path: "/sc", query: {} });
      window.open(href, '_blank');
    },
    async shoucang(lx, id, mc, item) {
      let res = await getsc({
        lx: lx,
        zyid: id,
        zymc: mc,
        yhid: this.yhm.id,
      });
      if (res.code == 0) {
        this.scs = id;

        this.$message({
          message: "收藏成功",
          type: "success",
        });
        return (item.sfsc = 1);
      } else {
        this.$message.error(res.msg);
      }
    },
    async qxshoucang(lx, id, item) {
      let res = await getqxsc({
        zylx: lx,
        zyid: id,
        yhid: this.yhm.id,
      });
      if (res.code == 0) {
        this.$message({
          message: "取消收藏成功",
          type: "success",
        });
        item.sfsc = "0";
      } else {
        this.$message.error(res.msg);
      }
    },
    fanhui() {
      sessionStorage.setItem("erjsnav", 3);
      sessionStorage.setItem("sousuo", this.mc);
      this.$router.push({
        path: "/s6",
        query: {},
      });
    },
    async handleCommand(command) {
      let res = await gettuichu()
      sessionStorage.removeItem("loginInfo")
      this.$router.push("/");
    },
    async yxxq(){
     let res = await getyxxq({
        id: this.id,
        type:this.lx
      });
     
      this.yxxqlist = res;
    },
    async handleCommand(command) {
      let res = await gettuichu()
      sessionStorage.removeItem("loginInfo")
      this.$router.push("/");
    },
    format(val) {
      return "2:52";
    },
    sousuos() {
      if (this.formInline.user == "") {
        this.$message.error({ message: "请输入搜索内容!", center: true });
      }
    },
    onSubmit() {
      // sessionStorage.setItem("erjsnav", 3);
      sessionStorage.setItem("erjsnav", 0);
      this.$router.push({
        path: "/retrieval",
        query: {},
      });
    },
    logins() {
      this.showLogin = !this.showLogin;
    },
    handleBlur() {
      this.activet = 0;
    },
    handleFocus() {
      this.activet = 1;
    },
    handleBlur1() {
      this.activet1 = 0;
    },
    handleFocus1() {
      this.activet1 = 1;
    },
  },
  computed: {},
  components: {
    footbtn,
  },
};
</script>
